<?php
/**
 * Created by dutuwang.net
 * User: adophper <hello@adophper.com>
 * Date: 2018/4/8
 * Time: 12:24
 */
use yii\helpers\Html;
$this->title = Yii::t('frontend', 'my_history');

?>
<?=Html::cssFile('/static/frontend/css/center.css')?>
<?=Html::jsFile('/static/frontend/js/swipe.js')?>
<div class="contBox">
    <div class="center_box row">
        <?=$this->render('left')?>
        <div class="col-md-10 right_min">
            <div class="right_box">
                <div class="his_title flex f_between"><label class="t_red">浏览历史</label></div>
                <div class="his_list_box">
                    <ul class="his_list fbox">
                        <?php
                        if (!empty($data['data'])) {
                            foreach ($data['data'] as $val) {
                        ?>
                        <li class="fl">
                            <div class="f_relative"><a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><img src="<?=$val['litpic']?>_250x150.jpg" alt="<?=$val['title']?>" /></a><a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>" class="t_o"><?=$val['title']?></a></div>
                            <p class="flex"><i class="t_red iconfont">&#xe615;</i><?=$val['show_start']?> 至 <?=$val['show_end']?></p>
                            <p class="flex"><i class="t_red iconfont">&#xe620;</i><?=$val['city']?></p>
                        </li>
                        <?php
                            }
                        }
                        ?>
                    </ul>
                    <div class="f_page flex f_end list-page">
                        <?php
                        if (!empty($data['data'])) {
                            echo \yii\widgets\LinkPager::widget([
                                'pagination' => $data['page'],
                            ]);
                        }
                        ?>
                    </div>
                </div>
            </div>
            <div class="right_box">
                <div class="his_title flex f_between"><label>展会推荐</label><a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/index'])?>">更多&gt;</a></div>
                <div class="his_list_box">
                    <div class="history_list">
                        <div class="history-nav swipe-nav swipe-nav-left">
                            <div class="swipe-nav-bar history-prev"><i class="iconfont">&#xe65d;</i></div>
                        </div>
                        <div class="swipe" id="slider2">
                            <div class="swipe-wrap">
                                <div class="left_min_list pull-left">
                                    <div class="clearfix">
                                        <?php
                                        if (!empty($recommend)) {
                                        $i = 1;
                                        $recommendCount = count($recommend);
                                        foreach ($recommend as $val) {
                                        ?>
                                        <div class="pull-left min_list_item_box" style="width: 33.33%">
                                            <div class="f_relative">
                                                <a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><img src="<?=$val['litpic']?>_184x150.jpg" alt="<?=$val['title']?>" /></a>
                                                <p class="t_o"><a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><?=$val['title']?></a></p>
                                            </div>
                                            <p class="flex t_o"><i class="t_red iconfont">&#xe615;</i><?=$val['show_start']?> 至 <?=$val['show_end']?></p>
                                            <p class="flex"><i class="t_red iconfont">&#xe620;</i><?=$val['city']?></p>
                                        </div>
                                        <?php
                                        if ($i % 3 == 0 && $i < $recommendCount) {
                                        ?>
                                    </div></div><div class="left_min_list pull-left"><div class="clearfix">
                                        <?php
                                        }
                                        $i++;
                                        }
                                        }
                                        ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="history-nav swipe-nav swipe-nav-right">
                            <div class="swipe-nav-bar history-next"><i class="iconfont">&#xe617;</i></div>
                        </div>
                        <script>
                            var slider2 = Swipe(document.getElementById('slider2'), {
                                auto: 3000,
                                continuous: true,
                                callback: function(pos) {}
                            });
                            $(function(){
                                $(".history-prev").click(function(e){
                                    e.preventDefault();
                                    slider2.prev();
                                });
                                $(".history-next").click(function(e){
                                    e.preventDefault();
                                    slider2.next();
                                });
                            });
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
